package DivorceTopOne4;

import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

public class DivorceTopOneReducer extends Reducer<DivorceBean, NullWritable,DivorceBean,NullWritable> {
    private  DivorceBean topOne = new DivorceBean();

    @Override
    protected void reduce(DivorceBean key, Iterable<NullWritable> values, Reducer<DivorceBean, NullWritable, DivorceBean, NullWritable>.Context context) throws IOException, InterruptedException {
        topOne.setProvince(key.getProvince());
        topOne.setCity(key.getCity());
        topOne.setDivorce(key.getDivorce());
        context.write(topOne,NullWritable.get());
    }
}


